<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libcoap: net.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">libcoap<span id="projectnumber">&#160;4.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('net_8c.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle"><div class="title">net.c File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;coap_config.h&quot;</code><br />
<code>#include &lt;ctype.h&gt;</code><br />
<code>#include &lt;stdio.h&gt;</code><br />
<code>#include &lt;errno.h&gt;</code><br />
<code>#include &quot;<a class="el" href="libcoap_8h_source.html">libcoap.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="utlist_8h_source.html">utlist.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="coap__debug_8h_source.html">coap_debug.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="mem_8h_source.html">mem.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="str_8h_source.html">str.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="async_8h_source.html">async.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="resource_8h_source.html">resource.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="option_8h_source.html">option.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="encode_8h_source.html">encode.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="block_8h_source.html">block.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="net_8h_source.html">net.h</a>&quot;</code><br />
</div>
<p><a href="net_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ac6afabdc09a49a433ee19d8a9486056d" id="r_ac6afabdc09a49a433ee19d8a9486056d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#ac6afabdc09a49a433ee19d8a9486056d">min</a>(a,  b)&#160;&#160;&#160;((a) &lt; (b) ? (a) : (b))</td></tr>
<tr class="separator:ac6afabdc09a49a433ee19d8a9486056d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ac65b37442b7b10d74dedeb7d25e737" id="r_a0ac65b37442b7b10d74dedeb7d25e737"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a0ac65b37442b7b10d74dedeb7d25e737">FRAC_BITS</a>&#160;&#160;&#160;6</td></tr>
<tr class="memdesc:a0ac65b37442b7b10d74dedeb7d25e737"><td class="mdescLeft">&#160;</td><td class="mdescRight">The number of bits for the fractional part of ACK_TIMEOUT and ACK_RANDOM_FACTOR.  <br /></td></tr>
<tr class="separator:a0ac65b37442b7b10d74dedeb7d25e737"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51c241e7ad52441b8d4c1fd5f498b3b9" id="r_a51c241e7ad52441b8d4c1fd5f498b3b9"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a51c241e7ad52441b8d4c1fd5f498b3b9">MAX_BITS</a>&#160;&#160;&#160;8</td></tr>
<tr class="memdesc:a51c241e7ad52441b8d4c1fd5f498b3b9"><td class="mdescLeft">&#160;</td><td class="mdescRight">The maximum number of bits for fixed point integers that are used for retransmission time calculation.  <br /></td></tr>
<tr class="separator:a51c241e7ad52441b8d4c1fd5f498b3b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aedd6a61216a54973fc7db5272affee75" id="r_aedd6a61216a54973fc7db5272affee75"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#aedd6a61216a54973fc7db5272affee75">Q</a>(frac,  fval)</td></tr>
<tr class="memdesc:aedd6a61216a54973fc7db5272affee75"><td class="mdescLeft">&#160;</td><td class="mdescRight">creates a Qx.frac from fval in <a class="el" href="structcoap__fixed__point__t.html" title="Abstraction of a fixed point number that can be used where necessary instead of a float.">coap_fixed_point_t</a>  <br /></td></tr>
<tr class="separator:aedd6a61216a54973fc7db5272affee75"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef339b3c4338bdb86736d679dc944b9e" id="r_aef339b3c4338bdb86736d679dc944b9e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#aef339b3c4338bdb86736d679dc944b9e">ACK_RANDOM_FACTOR</a>&#160;&#160;&#160;  <a class="el" href="net_8c.html#aedd6a61216a54973fc7db5272affee75">Q</a>(<a class="el" href="net_8c.html#a0ac65b37442b7b10d74dedeb7d25e737">FRAC_BITS</a>, session-&gt;ack_random_factor)</td></tr>
<tr class="memdesc:aef339b3c4338bdb86736d679dc944b9e"><td class="mdescLeft">&#160;</td><td class="mdescRight">creates a Qx.FRAC_BITS from session's 'ack_random_factor'  <br /></td></tr>
<tr class="separator:aef339b3c4338bdb86736d679dc944b9e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e53751a27267574b92f23d01951a259" id="r_a5e53751a27267574b92f23d01951a259"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a5e53751a27267574b92f23d01951a259">ACK_TIMEOUT</a>&#160;&#160;&#160;<a class="el" href="net_8c.html#aedd6a61216a54973fc7db5272affee75">Q</a>(<a class="el" href="net_8c.html#a0ac65b37442b7b10d74dedeb7d25e737">FRAC_BITS</a>, session-&gt;ack_timeout)</td></tr>
<tr class="memdesc:a5e53751a27267574b92f23d01951a259"><td class="mdescLeft">&#160;</td><td class="mdescRight">creates a Qx.FRAC_BITS from session's 'ack_timeout'  <br /></td></tr>
<tr class="separator:a5e53751a27267574b92f23d01951a259"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:add95b1f9de12dcad0e43d46c50e2feb0" id="r_add95b1f9de12dcad0e43d46c50e2feb0"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#add95b1f9de12dcad0e43d46c50e2feb0">FP1</a>&#160;&#160;&#160;<a class="el" href="net_8c.html#aedd6a61216a54973fc7db5272affee75">Q</a>(<a class="el" href="net_8c.html#a0ac65b37442b7b10d74dedeb7d25e737">FRAC_BITS</a>, ((<a class="el" href="structcoap__fixed__point__t.html">coap_fixed_point_t</a>){1,0}))</td></tr>
<tr class="separator:add95b1f9de12dcad0e43d46c50e2feb0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab7637b4488a03cae08c1115a21c16140" id="r_ab7637b4488a03cae08c1115a21c16140"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#ab7637b4488a03cae08c1115a21c16140">SHR_FP</a>(val,  frac)&#160;&#160;&#160;(((val) + (1 &lt;&lt; ((frac) - 1))) &gt;&gt; (frac))</td></tr>
<tr class="separator:ab7637b4488a03cae08c1115a21c16140"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a641a52ad5cdf4da5859aa7fc0e5fdf95" id="r_a641a52ad5cdf4da5859aa7fc0e5fdf95"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a641a52ad5cdf4da5859aa7fc0e5fdf95">SZX_TO_BYTES</a>(SZX)&#160;&#160;&#160;((size_t)(1 &lt;&lt; ((SZX) + 4)))</td></tr>
<tr class="separator:a641a52ad5cdf4da5859aa7fc0e5fdf95"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af776b22a727aae7c9f4d869d50df47e8" id="r_af776b22a727aae7c9f4d869d50df47e8"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#af776b22a727aae7c9f4d869d50df47e8">INET6_ADDRSTRLEN</a>&#160;&#160;&#160;40</td></tr>
<tr class="separator:af776b22a727aae7c9f4d869d50df47e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a19fccec23349a25f5daa69fc231cb415" id="r_a19fccec23349a25f5daa69fc231cb415"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a19fccec23349a25f5daa69fc231cb415">respond_t</a> { <a class="el" href="net_8c.html#a19fccec23349a25f5daa69fc231cb415a9eb4b37c5646776d1ad24355b3a6f745">RESPONSE_DEFAULT</a>
, <a class="el" href="net_8c.html#a19fccec23349a25f5daa69fc231cb415a94a97210dbcb738d9af4fd0de5f0aeff">RESPONSE_DROP</a>
, <a class="el" href="net_8c.html#a19fccec23349a25f5daa69fc231cb415aa8afbd3e995f285f48169283105947e4">RESPONSE_SEND</a>
 }</td></tr>
<tr class="memdesc:a19fccec23349a25f5daa69fc231cb415"><td class="mdescLeft">&#160;</td><td class="mdescRight">Internal flags to control the treatment of responses (specifically in presence of the No-Response option).  <a href="net_8c.html#a19fccec23349a25f5daa69fc231cb415">More...</a><br /></td></tr>
<tr class="separator:a19fccec23349a25f5daa69fc231cb415"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ad76ef4794cfee9fd5d3cd65e30f77b5d" id="r_ad76ef4794cfee9fd5d3cd65e30f77b5d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> <a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#ad76ef4794cfee9fd5d3cd65e30f77b5d">coap_malloc_node</a> (void)</td></tr>
<tr class="separator:ad76ef4794cfee9fd5d3cd65e30f77b5d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2f296838e4a779197c43b254e385ddc" id="r_aa2f296838e4a779197c43b254e385ddc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#aa2f296838e4a779197c43b254e385ddc">coap_free_node</a> (<a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *node)</td></tr>
<tr class="separator:aa2f296838e4a779197c43b254e385ddc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a157d58fe7840d7d7e36c40fff0825674" id="r_a157d58fe7840d7d7e36c40fff0825674"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a157d58fe7840d7d7e36c40fff0825674">coap_free_endpoint</a> (<a class="el" href="structcoap__endpoint__t.html">coap_endpoint_t</a> *ep)</td></tr>
<tr class="separator:a157d58fe7840d7d7e36c40fff0825674"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a116b4fec1683a94831f02b3e1a54dcac" id="r_a116b4fec1683a94831f02b3e1a54dcac"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a116b4fec1683a94831f02b3e1a54dcac">coap_adjust_basetime</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *ctx, <a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a> now)</td></tr>
<tr class="memdesc:a116b4fec1683a94831f02b3e1a54dcac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set sendqueue_basetime in the given context object <code>ctx</code> to <code>now</code>.  <br /></td></tr>
<tr class="separator:a116b4fec1683a94831f02b3e1a54dcac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80d2c3b0141e98bf3f7914e7e59b9530" id="r_a80d2c3b0141e98bf3f7914e7e59b9530"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a80d2c3b0141e98bf3f7914e7e59b9530">coap_insert_node</a> (<a class="el" href="structcoap__queue__t.html">coap_queue_t</a> **queue, <a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *node)</td></tr>
<tr class="memdesc:a80d2c3b0141e98bf3f7914e7e59b9530"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds <code>node</code> to given <code>queue</code>, ordered by variable t in <code>node</code>.  <br /></td></tr>
<tr class="separator:a80d2c3b0141e98bf3f7914e7e59b9530"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44c39a2314035989d3e07b9d9328e08c" id="r_a44c39a2314035989d3e07b9d9328e08c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a44c39a2314035989d3e07b9d9328e08c">coap_delete_node</a> (<a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *node)</td></tr>
<tr class="memdesc:a44c39a2314035989d3e07b9d9328e08c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroys specified <code>node</code>.  <br /></td></tr>
<tr class="separator:a44c39a2314035989d3e07b9d9328e08c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2c1e86998c712346baf2d116dbf1ac7f" id="r_a2c1e86998c712346baf2d116dbf1ac7f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a2c1e86998c712346baf2d116dbf1ac7f">coap_delete_all</a> (<a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *queue)</td></tr>
<tr class="memdesc:a2c1e86998c712346baf2d116dbf1ac7f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes all items from given <code>queue</code> and frees the allocated storage.  <br /></td></tr>
<tr class="separator:a2c1e86998c712346baf2d116dbf1ac7f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adbf4c617bdb13f0b61f83dca2ecdcc9e" id="r_adbf4c617bdb13f0b61f83dca2ecdcc9e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#adbf4c617bdb13f0b61f83dca2ecdcc9e">coap_new_node</a> (void)</td></tr>
<tr class="memdesc:adbf4c617bdb13f0b61f83dca2ecdcc9e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new node suitable for adding to the CoAP sendqueue.  <br /></td></tr>
<tr class="separator:adbf4c617bdb13f0b61f83dca2ecdcc9e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a9f7d31eafd7d82776f9b1a9291eea0" id="r_a4a9f7d31eafd7d82776f9b1a9291eea0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a4a9f7d31eafd7d82776f9b1a9291eea0">coap_peek_next</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context)</td></tr>
<tr class="memdesc:a4a9f7d31eafd7d82776f9b1a9291eea0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the next pdu to send without removing from sendqeue.  <br /></td></tr>
<tr class="separator:a4a9f7d31eafd7d82776f9b1a9291eea0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a740acba1e579ecec3c67eca3b7522164" id="r_a740acba1e579ecec3c67eca3b7522164"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a740acba1e579ecec3c67eca3b7522164">coap_pop_next</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context)</td></tr>
<tr class="memdesc:a740acba1e579ecec3c67eca3b7522164"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the next pdu to send and removes it from the sendqeue.  <br /></td></tr>
<tr class="separator:a740acba1e579ecec3c67eca3b7522164"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59140d9e3d88e6799879b6e4153b48a3" id="r_a59140d9e3d88e6799879b6e4153b48a3"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a59140d9e3d88e6799879b6e4153b48a3">coap_get_session_client_psk</a> (const <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *hint, size_t hint_len, <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *identity, size_t *identity_len, size_t max_identity_len, <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *psk, size_t max_psk_len)</td></tr>
<tr class="separator:a59140d9e3d88e6799879b6e4153b48a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a66445578ff7073e4add30c588f0625f6" id="r_a66445578ff7073e4add30c588f0625f6"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a66445578ff7073e4add30c588f0625f6">coap_get_context_server_psk</a> (const <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *identity, size_t identity_len, <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *psk, size_t max_psk_len)</td></tr>
<tr class="separator:a66445578ff7073e4add30c588f0625f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80fe575cbbf1ef5468165c3b94aabad4" id="r_a80fe575cbbf1ef5468165c3b94aabad4"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a80fe575cbbf1ef5468165c3b94aabad4">coap_get_context_server_hint</a> (const <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *hint, size_t max_hint_len)</td></tr>
<tr class="separator:a80fe575cbbf1ef5468165c3b94aabad4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aad4939d0311c2ba59cb097bc236fada1" id="r_aad4939d0311c2ba59cb097bc236fada1"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#aad4939d0311c2ba59cb097bc236fada1">coap_context_set_psk</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *ctx, const char *hint, const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *key, size_t key_len)</td></tr>
<tr class="memdesc:aad4939d0311c2ba59cb097bc236fada1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the context's default PSK hint and/or key for a server.  <br /></td></tr>
<tr class="separator:aad4939d0311c2ba59cb097bc236fada1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e6893a08fe41f0ad6fbb84f14b10c36" id="r_a3e6893a08fe41f0ad6fbb84f14b10c36"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a3e6893a08fe41f0ad6fbb84f14b10c36">coap_context_set_pki</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *ctx, <a class="el" href="structcoap__dtls__pki__t.html">coap_dtls_pki_t</a> *setup_data)</td></tr>
<tr class="memdesc:a3e6893a08fe41f0ad6fbb84f14b10c36"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the context's default PKI information for a server.  <br /></td></tr>
<tr class="separator:a3e6893a08fe41f0ad6fbb84f14b10c36"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec68afda9ae15e22114f0bec81785f6f" id="r_aec68afda9ae15e22114f0bec81785f6f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#aec68afda9ae15e22114f0bec81785f6f">coap_context_set_pki_root_cas</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *ctx, const char *ca_file, const char *ca_dir)</td></tr>
<tr class="memdesc:aec68afda9ae15e22114f0bec81785f6f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the context's default Root CA information for a client or server.  <br /></td></tr>
<tr class="separator:aec68afda9ae15e22114f0bec81785f6f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acc875c3095491f3835f4d252bd72999d" id="r_acc875c3095491f3835f4d252bd72999d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#acc875c3095491f3835f4d252bd72999d">coap_context_set_keepalive</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, unsigned int seconds)</td></tr>
<tr class="memdesc:acc875c3095491f3835f4d252bd72999d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the context keepalive timer for sessions.  <br /></td></tr>
<tr class="separator:acc875c3095491f3835f4d252bd72999d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ab369ca0a3c4fe7f8a9e0536346ff71" id="r_a1ab369ca0a3c4fe7f8a9e0536346ff71"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a1ab369ca0a3c4fe7f8a9e0536346ff71">coap_new_context</a> (const <a class="el" href="structcoap__address__t.html">coap_address_t</a> *listen_addr)</td></tr>
<tr class="memdesc:a1ab369ca0a3c4fe7f8a9e0536346ff71"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new <a class="el" href="structcoap__context__t.html" title="The CoAP stack&#39;s global state is stored in a coap_context_t object.">coap_context_t</a> object that will hold the CoAP stack status.  <br /></td></tr>
<tr class="separator:a1ab369ca0a3c4fe7f8a9e0536346ff71"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aae36aa264dea395214cf7aabcee5fcd9" id="r_aae36aa264dea395214cf7aabcee5fcd9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#aae36aa264dea395214cf7aabcee5fcd9">coap_set_app_data</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *ctx, void *app_data)</td></tr>
<tr class="memdesc:aae36aa264dea395214cf7aabcee5fcd9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stores <code>data</code> with the given CoAP context.  <br /></td></tr>
<tr class="separator:aae36aa264dea395214cf7aabcee5fcd9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ababc09609357f4709af861071fa6275f" id="r_ababc09609357f4709af861071fa6275f"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#ababc09609357f4709af861071fa6275f">coap_get_app_data</a> (const <a class="el" href="structcoap__context__t.html">coap_context_t</a> *ctx)</td></tr>
<tr class="memdesc:ababc09609357f4709af861071fa6275f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns any application-specific data that has been stored with <code>context</code> using the function <a class="el" href="net_8h.html#ace22e7d3745fb725552c929b4da55c61" title="Stores data with the given CoAP context.">coap_set_app_data()</a>.  <br /></td></tr>
<tr class="separator:ababc09609357f4709af861071fa6275f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a0717822713783908dd33d300440b2e" id="r_a4a0717822713783908dd33d300440b2e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a4a0717822713783908dd33d300440b2e">coap_free_context</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context)</td></tr>
<tr class="memdesc:a4a0717822713783908dd33d300440b2e"><td class="mdescLeft">&#160;</td><td class="mdescRight">CoAP stack context must be released with <a class="el" href="net_8h.html#a4a0717822713783908dd33d300440b2e" title="CoAP stack context must be released with coap_free_context().">coap_free_context()</a>.  <br /></td></tr>
<tr class="separator:a4a0717822713783908dd33d300440b2e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c6736c0418c3adf5e7f6fb76f000cfe" id="r_a9c6736c0418c3adf5e7f6fb76f000cfe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a9c6736c0418c3adf5e7f6fb76f000cfe">coap_option_check_critical</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *ctx, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *pdu, <a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a> unknown)</td></tr>
<tr class="memdesc:a9c6736c0418c3adf5e7f6fb76f000cfe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Verifies that <code>pdu</code> contains no unknown critical options.  <br /></td></tr>
<tr class="separator:a9c6736c0418c3adf5e7f6fb76f000cfe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba278b109415057d15196fa46afee970" id="r_aba278b109415057d15196fa46afee970"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pdu_8h.html#ac60fb9284ace878df3db4a2d621d9a8d">coap_tid_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#aba278b109415057d15196fa46afee970">coap_send_ack</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *request)</td></tr>
<tr class="memdesc:aba278b109415057d15196fa46afee970"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends an ACK message with code <code>0</code> for the specified <code>request</code> to <code>dst</code>.  <br /></td></tr>
<tr class="separator:aba278b109415057d15196fa46afee970"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf20c9b0b2ad3168c15e535a67ea3ce5" id="r_aaf20c9b0b2ad3168c15e535a67ea3ce5"><td class="memItemLeft" align="right" valign="top">ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#aaf20c9b0b2ad3168c15e535a67ea3ce5">coap_session_send_pdu</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *pdu)</td></tr>
<tr class="memdesc:aaf20c9b0b2ad3168c15e535a67ea3ce5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Send a pdu according to the session's protocol.  <br /></td></tr>
<tr class="separator:aaf20c9b0b2ad3168c15e535a67ea3ce5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c600aed61c8a8402d31ef795df3b0b6" id="r_a0c600aed61c8a8402d31ef795df3b0b6"><td class="memItemLeft" align="right" valign="top">static ssize_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a0c600aed61c8a8402d31ef795df3b0b6">coap_send_pdu</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *pdu, <a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *node)</td></tr>
<tr class="separator:a0c600aed61c8a8402d31ef795df3b0b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab31cd76353f751ec4dc5c033152df575" id="r_ab31cd76353f751ec4dc5c033152df575"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pdu_8h.html#ac60fb9284ace878df3db4a2d621d9a8d">coap_tid_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#ab31cd76353f751ec4dc5c033152df575">coap_send_error</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *request, unsigned char code, <a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a> opts)</td></tr>
<tr class="memdesc:ab31cd76353f751ec4dc5c033152df575"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends an error response with code <code>code</code> for request <code>request</code> to <code>dst</code>.  <br /></td></tr>
<tr class="separator:ab31cd76353f751ec4dc5c033152df575"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6aa830b46188549b51773f724eb8e752" id="r_a6aa830b46188549b51773f724eb8e752"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pdu_8h.html#ac60fb9284ace878df3db4a2d621d9a8d">coap_tid_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a6aa830b46188549b51773f724eb8e752">coap_send_message_type</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *request, unsigned char type)</td></tr>
<tr class="memdesc:a6aa830b46188549b51773f724eb8e752"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper funktion to create and send a message with <code>type</code> (usually ACK or RST).  <br /></td></tr>
<tr class="separator:a6aa830b46188549b51773f724eb8e752"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a816e87e31e2b90ada89eed085f016d93" id="r_a816e87e31e2b90ada89eed085f016d93"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a816e87e31e2b90ada89eed085f016d93">coap_calc_timeout</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, unsigned char r)</td></tr>
<tr class="memdesc:a816e87e31e2b90ada89eed085f016d93"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates the initial timeout based on the session CoAP transmission parameters 'ack_timeout', 'ack_random_factor', and COAP_TICKS_PER_SECOND.  <br /></td></tr>
<tr class="separator:a816e87e31e2b90ada89eed085f016d93"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7bee391c13b539a24d9f74b2fc23e08a" id="r_a7bee391c13b539a24d9f74b2fc23e08a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pdu_8h.html#ac60fb9284ace878df3db4a2d621d9a8d">coap_tid_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a7bee391c13b539a24d9f74b2fc23e08a">coap_wait_ack</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *node)</td></tr>
<tr class="separator:a7bee391c13b539a24d9f74b2fc23e08a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab0b0b5db03427c4313c01ec2b12cf8ed" id="r_ab0b0b5db03427c4313c01ec2b12cf8ed"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pdu_8h.html#ac60fb9284ace878df3db4a2d621d9a8d">coap_tid_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#ab0b0b5db03427c4313c01ec2b12cf8ed">coap_send</a> (<a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *pdu)</td></tr>
<tr class="memdesc:ab0b0b5db03427c4313c01ec2b12cf8ed"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sends a CoAP message to given peer.  <br /></td></tr>
<tr class="separator:ab0b0b5db03427c4313c01ec2b12cf8ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9900c032b74bd57f67d489484a2b3207" id="r_a9900c032b74bd57f67d489484a2b3207"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pdu_8h.html#ac60fb9284ace878df3db4a2d621d9a8d">coap_tid_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a9900c032b74bd57f67d489484a2b3207">coap_retransmit</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *node)</td></tr>
<tr class="memdesc:a9900c032b74bd57f67d489484a2b3207"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handles retransmissions of confirmable messages.  <br /></td></tr>
<tr class="separator:a9900c032b74bd57f67d489484a2b3207"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8534f7860b14e0743529daff196a27ce" id="r_a8534f7860b14e0743529daff196a27ce"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a8534f7860b14e0743529daff196a27ce">coap_handle_dgram_for_proto</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *ctx, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="structcoap__packet__t.html">coap_packet_t</a> *packet)</td></tr>
<tr class="separator:a8534f7860b14e0743529daff196a27ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e7c7fc083799c942c9c44ebc190c833" id="r_a9e7c7fc083799c942c9c44ebc190c833"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a9e7c7fc083799c942c9c44ebc190c833">coap_connect_session</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *ctx, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a> now)</td></tr>
<tr class="separator:a9e7c7fc083799c942c9c44ebc190c833"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8fe30a827bdd0d518fc5c5a3a860dfde" id="r_a8fe30a827bdd0d518fc5c5a3a860dfde"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a8fe30a827bdd0d518fc5c5a3a860dfde">coap_write_session</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *ctx, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a> now)</td></tr>
<tr class="separator:a8fe30a827bdd0d518fc5c5a3a860dfde"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acd36f6fba6d30ab9557e0e6521f4a088" id="r_acd36f6fba6d30ab9557e0e6521f4a088"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#acd36f6fba6d30ab9557e0e6521f4a088">coap_read_session</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *ctx, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a> now)</td></tr>
<tr class="separator:acd36f6fba6d30ab9557e0e6521f4a088"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44ffb4b70e537043e9a9cf344be24b92" id="r_a44ffb4b70e537043e9a9cf344be24b92"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a44ffb4b70e537043e9a9cf344be24b92">coap_read_endpoint</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *ctx, <a class="el" href="structcoap__endpoint__t.html">coap_endpoint_t</a> *endpoint, <a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a> now)</td></tr>
<tr class="separator:a44ffb4b70e537043e9a9cf344be24b92"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a823b9397a80e37f7ae87a5581430c507" id="r_a823b9397a80e37f7ae87a5581430c507"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a823b9397a80e37f7ae87a5581430c507">coap_write_endpoint</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *ctx, <a class="el" href="structcoap__endpoint__t.html">coap_endpoint_t</a> *endpoint, <a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a> now)</td></tr>
<tr class="separator:a823b9397a80e37f7ae87a5581430c507"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7437c90770ffd13685e6a77799b4753b" id="r_a7437c90770ffd13685e6a77799b4753b"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a7437c90770ffd13685e6a77799b4753b">coap_accept_endpoint</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *ctx, <a class="el" href="structcoap__endpoint__t.html">coap_endpoint_t</a> *endpoint, <a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a> now)</td></tr>
<tr class="separator:a7437c90770ffd13685e6a77799b4753b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0748d791fd2af516dd93fbadb660d440" id="r_a0748d791fd2af516dd93fbadb660d440"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a0748d791fd2af516dd93fbadb660d440">coap_read</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *ctx, <a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a> now)</td></tr>
<tr class="memdesc:a0748d791fd2af516dd93fbadb660d440"><td class="mdescLeft">&#160;</td><td class="mdescRight">For applications with their own message loop, reads all data from the network.  <br /></td></tr>
<tr class="separator:a0748d791fd2af516dd93fbadb660d440"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a32887948ee273d1ad464ec47df194910" id="r_a32887948ee273d1ad464ec47df194910"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a32887948ee273d1ad464ec47df194910">coap_handle_dgram</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *ctx, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *msg, size_t msg_len)</td></tr>
<tr class="memdesc:a32887948ee273d1ad464ec47df194910"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parses and interprets a CoAP datagram with context <code>ctx</code>.  <br /></td></tr>
<tr class="separator:a32887948ee273d1ad464ec47df194910"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a480a3e967feaf00778dedf4c2fc68bd2" id="r_a480a3e967feaf00778dedf4c2fc68bd2"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a480a3e967feaf00778dedf4c2fc68bd2">coap_remove_from_queue</a> (<a class="el" href="structcoap__queue__t.html">coap_queue_t</a> **queue, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="pdu_8h.html#ac60fb9284ace878df3db4a2d621d9a8d">coap_tid_t</a> id, <a class="el" href="structcoap__queue__t.html">coap_queue_t</a> **node)</td></tr>
<tr class="memdesc:a480a3e967feaf00778dedf4c2fc68bd2"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function removes the element with given <code>id</code> from the list given list.  <br /></td></tr>
<tr class="separator:a480a3e967feaf00778dedf4c2fc68bd2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a172ec052726c632427ea990a0ba04c60" id="r_a172ec052726c632427ea990a0ba04c60"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a172ec052726c632427ea990a0ba04c60">token_match</a> (const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *a, size_t alen, const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *b, size_t blen)</td></tr>
<tr class="separator:a172ec052726c632427ea990a0ba04c60"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:add0197ad2daf24535c85e0ba1d28f099" id="r_add0197ad2daf24535c85e0ba1d28f099"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#add0197ad2daf24535c85e0ba1d28f099">coap_cancel_session_messages</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="coap__io_8h.html#a7ff2bb32137ca684be5539c156bdc418">coap_nack_reason_t</a> reason)</td></tr>
<tr class="memdesc:add0197ad2daf24535c85e0ba1d28f099"><td class="mdescLeft">&#160;</td><td class="mdescRight">Cancels all outstanding messages for session <code>session</code>.  <br /></td></tr>
<tr class="separator:add0197ad2daf24535c85e0ba1d28f099"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab0ffe6312ad95fb07b0212f912cf196c" id="r_ab0ffe6312ad95fb07b0212f912cf196c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#ab0ffe6312ad95fb07b0212f912cf196c">coap_cancel_all_messages</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *token, size_t token_length)</td></tr>
<tr class="memdesc:ab0ffe6312ad95fb07b0212f912cf196c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Cancels all outstanding messages for session <code>session</code> that have the specified token.  <br /></td></tr>
<tr class="separator:ab0ffe6312ad95fb07b0212f912cf196c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3065434dae5c177558462dddc61d5514" id="r_a3065434dae5c177558462dddc61d5514"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a3065434dae5c177558462dddc61d5514">coap_find_transaction</a> (<a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *queue, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="pdu_8h.html#ac60fb9284ace878df3db4a2d621d9a8d">coap_tid_t</a> id)</td></tr>
<tr class="memdesc:a3065434dae5c177558462dddc61d5514"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves transaction from the queue.  <br /></td></tr>
<tr class="separator:a3065434dae5c177558462dddc61d5514"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa54bb684429ee455f119fc5fb1feb197" id="r_aa54bb684429ee455f119fc5fb1feb197"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#aa54bb684429ee455f119fc5fb1feb197">coap_new_error_response</a> (<a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *request, unsigned char code, <a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a> opts)</td></tr>
<tr class="memdesc:aa54bb684429ee455f119fc5fb1feb197"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new ACK PDU with specified error <code>code</code>.  <br /></td></tr>
<tr class="separator:aa54bb684429ee455f119fc5fb1feb197"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4dc6e755dca2ca804e8700f398f4c329" id="r_a4dc6e755dca2ca804e8700f398f4c329"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a4dc6e755dca2ca804e8700f398f4c329">get_wkc_len</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *query_filter)</td></tr>
<tr class="memdesc:a4dc6e755dca2ca804e8700f398f4c329"><td class="mdescLeft">&#160;</td><td class="mdescRight">Quick hack to determine the size of the resource description for .well-known/core.  <br /></td></tr>
<tr class="separator:a4dc6e755dca2ca804e8700f398f4c329"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b9a31728201d9c7c032513a185854ff" id="r_a4b9a31728201d9c7c032513a185854ff"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a4b9a31728201d9c7c032513a185854ff">coap_wellknown_response</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *request)</td></tr>
<tr class="memdesc:a4b9a31728201d9c7c032513a185854ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new response for given <code>request</code> with the contents of <code></code>.well-known/core.  <br /></td></tr>
<tr class="separator:a4b9a31728201d9c7c032513a185854ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6b355153e3bba3af3df1e72f33ced85c" id="r_a6b355153e3bba3af3df1e72f33ced85c"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a6b355153e3bba3af3df1e72f33ced85c">coap_cancel</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, const <a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *sent)</td></tr>
<tr class="memdesc:a6b355153e3bba3af3df1e72f33ced85c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function cancels outstanding messages for the session and token specified in <code>sent</code>.  <br /></td></tr>
<tr class="separator:a6b355153e3bba3af3df1e72f33ced85c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa708f479d33a6ca76bf214a0e0e42de4" id="r_aa708f479d33a6ca76bf214a0e0e42de4"><td class="memItemLeft" align="right" valign="top">static enum <a class="el" href="net_8c.html#a19fccec23349a25f5daa69fc231cb415">respond_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#aa708f479d33a6ca76bf214a0e0e42de4">no_response</a> (<a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *request, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *response)</td></tr>
<tr class="memdesc:aa708f479d33a6ca76bf214a0e0e42de4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks for No-Response option in given <code>request</code> and returns <code>1</code> if <code>response</code> should be suppressed according to RFC 7967.  <br /></td></tr>
<tr class="separator:aa708f479d33a6ca76bf214a0e0e42de4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1a280312c4bad55cf10243b9b9c3e966" id="r_a1a280312c4bad55cf10243b9b9c3e966"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a1a280312c4bad55cf10243b9b9c3e966">handle_request</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *pdu)</td></tr>
<tr class="separator:a1a280312c4bad55cf10243b9b9c3e966"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af838d89087ad96495f8ed7f1a9297168" id="r_af838d89087ad96495f8ed7f1a9297168"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#af838d89087ad96495f8ed7f1a9297168">handle_response</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *sent, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *rcvd)</td></tr>
<tr class="separator:af838d89087ad96495f8ed7f1a9297168"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4cbcfd073489b57805db665ce3d0681" id="r_ac4cbcfd073489b57805db665ce3d0681"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#ac4cbcfd073489b57805db665ce3d0681">handle_signaling</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *pdu)</td></tr>
<tr class="separator:ac4cbcfd073489b57805db665ce3d0681"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7bb944fc52f772655356d95724317401" id="r_a7bb944fc52f772655356d95724317401"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a7bb944fc52f772655356d95724317401">coap_dispatch</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *pdu)</td></tr>
<tr class="memdesc:a7bb944fc52f772655356d95724317401"><td class="mdescLeft">&#160;</td><td class="mdescRight">Dispatches the PDUs from the receive queue in given context.  <br /></td></tr>
<tr class="separator:a7bb944fc52f772655356d95724317401"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e2cee998ccf618ac07aa54f5e5f8743" id="r_a5e2cee998ccf618ac07aa54f5e5f8743"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a5e2cee998ccf618ac07aa54f5e5f8743">coap_handle_event</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context, <a class="el" href="group__events.html#ga75a08ceb9a855937288ac3996656c872">coap_event_t</a> event, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session)</td></tr>
<tr class="memdesc:a5e2cee998ccf618ac07aa54f5e5f8743"><td class="mdescLeft">&#160;</td><td class="mdescRight">Invokes the event handler of <code>context</code> for the given <code>event</code> and <code>data</code>.  <br /></td></tr>
<tr class="separator:a5e2cee998ccf618ac07aa54f5e5f8743"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a231e9a81ac7c03c3e5c251824a76d7b9" id="r_a231e9a81ac7c03c3e5c251824a76d7b9"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a231e9a81ac7c03c3e5c251824a76d7b9">coap_can_exit</a> (<a class="el" href="structcoap__context__t.html">coap_context_t</a> *context)</td></tr>
<tr class="memdesc:a231e9a81ac7c03c3e5c251824a76d7b9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns 1 if there are no messages to send or to dispatch in the context's queues.  <br /></td></tr>
<tr class="separator:a231e9a81ac7c03c3e5c251824a76d7b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aceceb550566e0ab9e184d09604a73bb6" id="r_aceceb550566e0ab9e184d09604a73bb6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#aceceb550566e0ab9e184d09604a73bb6">coap_startup</a> (void)</td></tr>
<tr class="separator:aceceb550566e0ab9e184d09604a73bb6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d1fb0b44497970b0f75fa0b38570a82" id="r_a5d1fb0b44497970b0f75fa0b38570a82"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a5d1fb0b44497970b0f75fa0b38570a82">coap_cleanup</a> (void)</td></tr>
<tr class="separator:a5d1fb0b44497970b0f75fa0b38570a82"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a3e4402058bf2b1ef0b513175af4e600d" id="r_a3e4402058bf2b1ef0b513175af4e600d"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a3e4402058bf2b1ef0b513175af4e600d">coap_default_uri_wellknown</a></td></tr>
<tr class="separator:a3e4402058bf2b1ef0b513175af4e600d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a73dd0093b2de859341ebbb375b0efad5" id="r_a73dd0093b2de859341ebbb375b0efad5"><td class="memItemLeft" align="right" valign="top">static int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="net_8c.html#a73dd0093b2de859341ebbb375b0efad5">coap_started</a> = 0</td></tr>
<tr class="separator:a73dd0093b2de859341ebbb375b0efad5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="aef339b3c4338bdb86736d679dc944b9e" name="aef339b3c4338bdb86736d679dc944b9e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aef339b3c4338bdb86736d679dc944b9e">&#9670;&#160;</a></span>ACK_RANDOM_FACTOR</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ACK_RANDOM_FACTOR&#160;&#160;&#160;  <a class="el" href="net_8c.html#aedd6a61216a54973fc7db5272affee75">Q</a>(<a class="el" href="net_8c.html#a0ac65b37442b7b10d74dedeb7d25e737">FRAC_BITS</a>, session-&gt;ack_random_factor)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>creates a Qx.FRAC_BITS from session's 'ack_random_factor' </p>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00082">82</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a5e53751a27267574b92f23d01951a259" name="a5e53751a27267574b92f23d01951a259"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5e53751a27267574b92f23d01951a259">&#9670;&#160;</a></span>ACK_TIMEOUT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define ACK_TIMEOUT&#160;&#160;&#160;<a class="el" href="net_8c.html#aedd6a61216a54973fc7db5272affee75">Q</a>(<a class="el" href="net_8c.html#a0ac65b37442b7b10d74dedeb7d25e737">FRAC_BITS</a>, session-&gt;ack_timeout)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>creates a Qx.FRAC_BITS from session's 'ack_timeout' </p>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00086">86</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="add95b1f9de12dcad0e43d46c50e2feb0" name="add95b1f9de12dcad0e43d46c50e2feb0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#add95b1f9de12dcad0e43d46c50e2feb0">&#9670;&#160;</a></span>FP1</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define FP1&#160;&#160;&#160;<a class="el" href="net_8c.html#aedd6a61216a54973fc7db5272affee75">Q</a>(<a class="el" href="net_8c.html#a0ac65b37442b7b10d74dedeb7d25e737">FRAC_BITS</a>, ((<a class="el" href="structcoap__fixed__point__t.html">coap_fixed_point_t</a>){1,0}))</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a0ac65b37442b7b10d74dedeb7d25e737" name="a0ac65b37442b7b10d74dedeb7d25e737"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0ac65b37442b7b10d74dedeb7d25e737">&#9670;&#160;</a></span>FRAC_BITS</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define FRAC_BITS&#160;&#160;&#160;6</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The number of bits for the fractional part of ACK_TIMEOUT and ACK_RANDOM_FACTOR. </p>
<p>Must be less or equal 8. </p>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00065">65</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="af776b22a727aae7c9f4d869d50df47e8" name="af776b22a727aae7c9f4d869d50df47e8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af776b22a727aae7c9f4d869d50df47e8">&#9670;&#160;</a></span>INET6_ADDRSTRLEN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define INET6_ADDRSTRLEN&#160;&#160;&#160;40</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a51c241e7ad52441b8d4c1fd5f498b3b9" name="a51c241e7ad52441b8d4c1fd5f498b3b9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a51c241e7ad52441b8d4c1fd5f498b3b9">&#9670;&#160;</a></span>MAX_BITS</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define MAX_BITS&#160;&#160;&#160;8</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The maximum number of bits for fixed point integers that are used for retransmission time calculation. </p>
<p>Currently this must be <code>8</code>. </p>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00071">71</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="ac6afabdc09a49a433ee19d8a9486056d" name="ac6afabdc09a49a433ee19d8a9486056d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac6afabdc09a49a433ee19d8a9486056d">&#9670;&#160;</a></span>min</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define min</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;((a) &lt; (b) ? (a) : (b))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00058">58</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="aedd6a61216a54973fc7db5272affee75" name="aedd6a61216a54973fc7db5272affee75"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aedd6a61216a54973fc7db5272affee75">&#9670;&#160;</a></span>Q</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define Q</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">frac, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">fval&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<b>Value:</b><div class="fragment"><div class="line">                      ((uint16_t)(((1 &lt;&lt; (frac)) * fval.integer_part) + \</div>
<div class="line">                      ((1 &lt;&lt; (frac)) * fval.fractional_part + 500)/1000))</div>
</div><!-- fragment -->
<p>creates a Qx.frac from fval in <a class="el" href="structcoap__fixed__point__t.html" title="Abstraction of a fixed point number that can be used where necessary instead of a float.">coap_fixed_point_t</a> </p>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00078">78</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="ab7637b4488a03cae08c1115a21c16140" name="ab7637b4488a03cae08c1115a21c16140"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab7637b4488a03cae08c1115a21c16140">&#9670;&#160;</a></span>SHR_FP</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SHR_FP</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">val, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">frac&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;(((val) + (1 &lt;&lt; ((frac) - 1))) &gt;&gt; (frac))</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a641a52ad5cdf4da5859aa7fc0e5fdf95" name="a641a52ad5cdf4da5859aa7fc0e5fdf95"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a641a52ad5cdf4da5859aa7fc0e5fdf95">&#9670;&#160;</a></span>SZX_TO_BYTES</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define SZX_TO_BYTES</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">SZX</td><td>)</td>
          <td>&#160;&#160;&#160;((size_t)(1 &lt;&lt; ((SZX) + 4)))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01646">1646</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="a19fccec23349a25f5daa69fc231cb415" name="a19fccec23349a25f5daa69fc231cb415"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a19fccec23349a25f5daa69fc231cb415">&#9670;&#160;</a></span>respond_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="net_8c.html#a19fccec23349a25f5daa69fc231cb415">respond_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Internal flags to control the treatment of responses (specifically in presence of the No-Response option). </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a19fccec23349a25f5daa69fc231cb415a9eb4b37c5646776d1ad24355b3a6f745" name="a19fccec23349a25f5daa69fc231cb415a9eb4b37c5646776d1ad24355b3a6f745"></a>RESPONSE_DEFAULT&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a19fccec23349a25f5daa69fc231cb415a94a97210dbcb738d9af4fd0de5f0aeff" name="a19fccec23349a25f5daa69fc231cb415a94a97210dbcb738d9af4fd0de5f0aeff"></a>RESPONSE_DROP&#160;</td><td class="fielddoc"></td></tr>
<tr><td class="fieldname"><a id="a19fccec23349a25f5daa69fc231cb415aa8afbd3e995f285f48169283105947e4" name="a19fccec23349a25f5daa69fc231cb415aa8afbd3e995f285f48169283105947e4"></a>RESPONSE_SEND&#160;</td><td class="fielddoc"></td></tr>
</table>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01812">1812</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a7437c90770ffd13685e6a77799b4753b" name="a7437c90770ffd13685e6a77799b4753b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7437c90770ffd13685e6a77799b4753b">&#9670;&#160;</a></span>coap_accept_endpoint()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int coap_accept_endpoint </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__endpoint__t.html">coap_endpoint_t</a> *&#160;</td>
          <td class="paramname"><em>endpoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a>&#160;</td>
          <td class="paramname"><em>now</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01310">1310</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a116b4fec1683a94831f02b3e1a54dcac" name="a116b4fec1683a94831f02b3e1a54dcac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a116b4fec1683a94831f02b3e1a54dcac">&#9670;&#160;</a></span>coap_adjust_basetime()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int coap_adjust_basetime </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a>&#160;</td>
          <td class="paramname"><em>now</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set sendqueue_basetime in the given context object <code>ctx</code> to <code>now</code>. </p>
<p>This function returns the number of elements in the queue head that have timed out. </p>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00151">151</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a816e87e31e2b90ada89eed085f016d93" name="a816e87e31e2b90ada89eed085f016d93"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a816e87e31e2b90ada89eed085f016d93">&#9670;&#160;</a></span>coap_calc_timeout()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int coap_calc_timeout </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>r</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculates the initial timeout based on the session CoAP transmission parameters 'ack_timeout', 'ack_random_factor', and COAP_TICKS_PER_SECOND. </p>
<p>The calculation requires 'ack_timeout' and 'ack_random_factor' to be in Qx.FRAC_BITS fixed point notation, whereas the passed parameter <code>r</code> is interpreted as the fractional part of a Q0.MAX_BITS random value.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">session</td><td>session timeout is associated with </td></tr>
    <tr><td class="paramname">r</td><td>random value as fractional part of a Q0.MAX_BITS fixed point value </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>COAP_TICKS_PER_SECOND * 'ack_timeout' * (1 + ('ack_random_factor' - 1) * r) </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00798">798</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a231e9a81ac7c03c3e5c251824a76d7b9" name="a231e9a81ac7c03c3e5c251824a76d7b9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a231e9a81ac7c03c3e5c251824a76d7b9">&#9670;&#160;</a></span>coap_can_exit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_can_exit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns 1 if there are no messages to send or to dispatch in the context's queues. </p>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l02321">2321</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a6b355153e3bba3af3df1e72f33ced85c" name="a6b355153e3bba3af3df1e72f33ced85c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6b355153e3bba3af3df1e72f33ced85c">&#9670;&#160;</a></span>coap_cancel()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int coap_cancel </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *&#160;</td>
          <td class="paramname"><em>sent</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>This function cancels outstanding messages for the session and token specified in <code>sent</code>. </p>
<p>Any observation relationship for sent-&gt;session and the token are removed. Calling this function is required when receiving an RST message (usually in response to a notification) or a GET request with the Observe option set to 1.</p>
<p>This function returns <code>0</code> when the token is unknown with this peer, or a value greater than zero otherwise. </p>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01786">1786</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="ab0ffe6312ad95fb07b0212f912cf196c" name="ab0ffe6312ad95fb07b0212f912cf196c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab0ffe6312ad95fb07b0212f912cf196c">&#9670;&#160;</a></span>coap_cancel_all_messages()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_cancel_all_messages </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>token</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>token_length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Cancels all outstanding messages for session <code>session</code> that have the specified token. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The context in use. </td></tr>
    <tr><td class="paramname">session</td><td>Session of the messages to remove. </td></tr>
    <tr><td class="paramname">token</td><td>Message token. </td></tr>
    <tr><td class="paramname">token_length</td><td>Actual length of <code>token</code>. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01484">1484</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="add0197ad2daf24535c85e0ba1d28f099" name="add0197ad2daf24535c85e0ba1d28f099"></a>
<h2 class="memtitle"><span class="permalink"><a href="#add0197ad2daf24535c85e0ba1d28f099">&#9670;&#160;</a></span>coap_cancel_session_messages()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_cancel_session_messages </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="coap__io_8h.html#a7ff2bb32137ca684be5539c156bdc418">coap_nack_reason_t</a>&#160;</td>
          <td class="paramname"><em>reason</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Cancels all outstanding messages for session <code>session</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The context in use. </td></tr>
    <tr><td class="paramname">session</td><td>Session of the messages to remove. </td></tr>
    <tr><td class="paramname">reason</td><td>The reasion for the session cancellation </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01447">1447</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a5d1fb0b44497970b0f75fa0b38570a82" name="a5d1fb0b44497970b0f75fa0b38570a82"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5d1fb0b44497970b0f75fa0b38570a82">&#9670;&#160;</a></span>coap_cleanup()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_cleanup </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l02363">2363</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a9e7c7fc083799c942c9c44ebc190c833" name="a9e7c7fc083799c942c9c44ebc190c833"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9e7c7fc083799c942c9c44ebc190c833">&#9670;&#160;</a></span>coap_connect_session()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void coap_connect_session </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a>&#160;</td>
          <td class="paramname"><em>now</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01043">1043</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="acc875c3095491f3835f4d252bd72999d" name="acc875c3095491f3835f4d252bd72999d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acc875c3095491f3835f4d252bd72999d">&#9670;&#160;</a></span>coap_context_set_keepalive()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_context_set_keepalive </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>seconds</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the context keepalive timer for sessions. </p>
<p>A keepalive message will be sent after if a session has been inactive, i.e. no packet sent or received, for the given number of seconds. For reliable protocols, a PING message will be sent. If a PONG has not been received before the next PING is due to be sent, the session will considered as disconnected.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The <a class="el" href="structcoap__context__t.html" title="The CoAP stack&#39;s global state is stored in a coap_context_t object.">coap_context_t</a> object. </td></tr>
    <tr><td class="paramname">seconds</td><td>Number of seconds for the inactivity timer, or zero to disable CoAP-level keepalive messages.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 if successful, else 0 </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00417">417</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a3e6893a08fe41f0ad6fbb84f14b10c36" name="a3e6893a08fe41f0ad6fbb84f14b10c36"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3e6893a08fe41f0ad6fbb84f14b10c36">&#9670;&#160;</a></span>coap_context_set_pki()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_context_set_pki </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__dtls__pki__t.html">coap_dtls_pki_t</a> *&#160;</td>
          <td class="paramname"><em>setup_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the context's default PKI information for a server. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The current <a class="el" href="structcoap__context__t.html" title="The CoAP stack&#39;s global state is stored in a coap_context_t object.">coap_context_t</a> object. </td></tr>
    <tr><td class="paramname">setup_data</td><td>If <code>NULL</code>, PKI authentication will fail. Certificate information required.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if successful, else <code>0</code>. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00392">392</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="aec68afda9ae15e22114f0bec81785f6f" name="aec68afda9ae15e22114f0bec81785f6f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aec68afda9ae15e22114f0bec81785f6f">&#9670;&#160;</a></span>coap_context_set_pki_root_cas()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_context_set_pki_root_cas </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>ca_file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>ca_dir</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the context's default Root CA information for a client or server. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The current <a class="el" href="structcoap__context__t.html" title="The CoAP stack&#39;s global state is stored in a coap_context_t object.">coap_context_t</a> object. </td></tr>
    <tr><td class="paramname">ca_file</td><td>If not <code>NULL</code>, is the full path name of a PEM encoded file containing all the Root CAs to be used. </td></tr>
    <tr><td class="paramname">ca_dir</td><td>If not <code>NULL</code>, points to a directory containing PEM encoded files containing all the Root CAs to be used.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if successful, else <code>0</code>. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00407">407</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="aad4939d0311c2ba59cb097bc236fada1" name="aad4939d0311c2ba59cb097bc236fada1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aad4939d0311c2ba59cb097bc236fada1">&#9670;&#160;</a></span>coap_context_set_psk()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_context_set_psk </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>hint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>key_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the context's default PSK hint and/or key for a server. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The current <a class="el" href="structcoap__context__t.html" title="The CoAP stack&#39;s global state is stored in a coap_context_t object.">coap_context_t</a> object. </td></tr>
    <tr><td class="paramname">hint</td><td>The default PSK server hint sent to a client. If <code>NULL</code>, PSK authentication is disabled. Empty string is a valid hint. </td></tr>
    <tr><td class="paramname">key</td><td>The default PSK key. If <code>NULL</code>, PSK authentication will fail. </td></tr>
    <tr><td class="paramname">key_len</td><td>The default PSK key's length. If <code>0</code>, PSK authentication will fail.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if successful, else <code>0</code>. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00349">349</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a2c1e86998c712346baf2d116dbf1ac7f" name="a2c1e86998c712346baf2d116dbf1ac7f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2c1e86998c712346baf2d116dbf1ac7f">&#9670;&#160;</a></span>coap_delete_all()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_delete_all </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *&#160;</td>
          <td class="paramname"><em>queue</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Removes all items from given <code>queue</code> and frees the allocated storage. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">queue</td><td>The queue to delete. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00245">245</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a44c39a2314035989d3e07b9d9328e08c" name="a44c39a2314035989d3e07b9d9328e08c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a44c39a2314035989d3e07b9d9328e08c">&#9670;&#160;</a></span>coap_delete_node()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_delete_node </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *&#160;</td>
          <td class="paramname"><em>node</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destroys specified <code>node</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">node</td><td>Node entry to remove.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> node deleted from queue, <code>0</code> failure. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00225">225</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a7bb944fc52f772655356d95724317401" name="a7bb944fc52f772655356d95724317401"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7bb944fc52f772655356d95724317401">&#9670;&#160;</a></span>coap_dispatch()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_dispatch </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td>
          <td class="paramname"><em>pdu</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Dispatches the PDUs from the receive queue in given context. </p>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l02169">2169</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a3065434dae5c177558462dddc61d5514" name="a3065434dae5c177558462dddc61d5514"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3065434dae5c177558462dddc61d5514">&#9670;&#160;</a></span>coap_find_transaction()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__queue__t.html">coap_queue_t</a> * coap_find_transaction </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *&#160;</td>
          <td class="paramname"><em>queue</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="pdu_8h.html#ac60fb9284ace878df3db4a2d621d9a8d">coap_tid_t</a>&#160;</td>
          <td class="paramname"><em>id</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieves transaction from the queue. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">queue</td><td>The transaction queue to be searched. </td></tr>
    <tr><td class="paramname">session</td><td>The session to find. </td></tr>
    <tr><td class="paramname">id</td><td>The transaction id to find.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the transaction object or <code>NULL</code> if not found. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01525">1525</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a4a0717822713783908dd33d300440b2e" name="a4a0717822713783908dd33d300440b2e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4a0717822713783908dd33d300440b2e">&#9670;&#160;</a></span>coap_free_context()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_free_context </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>CoAP stack context must be released with <a class="el" href="net_8h.html#a4a0717822713783908dd33d300440b2e" title="CoAP stack context must be released with coap_free_context().">coap_free_context()</a>. </p>
<p>This function clears all entries from the receive queue and send queue and deletes the resources that have been registered with <code>context</code>, and frees the attached endpoints.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The current <a class="el" href="structcoap__context__t.html" title="The CoAP stack&#39;s global state is stored in a coap_context_t object.">coap_context_t</a> object to free off. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00518">518</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a157d58fe7840d7d7e36c40fff0825674" name="a157d58fe7840d7d7e36c40fff0825674"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a157d58fe7840d7d7e36c40fff0825674">&#9670;&#160;</a></span>coap_free_endpoint()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_free_endpoint </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__endpoint__t.html">coap_endpoint_t</a> *&#160;</td>
          <td class="paramname"><em>ep</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="coap__session_8c_source.html#l00901">901</a> of file <a class="el" href="coap__session_8c_source.html">coap_session.c</a>.</p>

</div>
</div>
<a id="aa2f296838e4a779197c43b254e385ddc" name="aa2f296838e4a779197c43b254e385ddc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa2f296838e4a779197c43b254e385ddc">&#9670;&#160;</a></span>coap_free_node()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> void coap_free_node </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *&#160;</td>
          <td class="paramname"><em>node</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00096">96</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="ababc09609357f4709af861071fa6275f" name="ababc09609357f4709af861071fa6275f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ababc09609357f4709af861071fa6275f">&#9670;&#160;</a></span>coap_get_app_data()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void * coap_get_app_data </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns any application-specific data that has been stored with <code>context</code> using the function <a class="el" href="net_8h.html#ace22e7d3745fb725552c929b4da55c61" title="Stores data with the given CoAP context.">coap_set_app_data()</a>. </p>
<p>This function will return <code>NULL</code> if no data has been stored.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The CoAP context.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The data previously stored or <code>NULL</code> if not data stored. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00512">512</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a80fe575cbbf1ef5468165c3b94aabad4" name="a80fe575cbbf1ef5468165c3b94aabad4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a80fe575cbbf1ef5468165c3b94aabad4">&#9670;&#160;</a></span>coap_get_context_server_hint()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t coap_get_context_server_hint </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>hint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>max_hint_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00337">337</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a66445578ff7073e4add30c588f0625f6" name="a66445578ff7073e4add30c588f0625f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a66445578ff7073e4add30c588f0625f6">&#9670;&#160;</a></span>coap_get_context_server_psk()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t coap_get_context_server_psk </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>identity</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>identity_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>psk</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>max_psk_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00321">321</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a59140d9e3d88e6799879b6e4153b48a3" name="a59140d9e3d88e6799879b6e4153b48a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a59140d9e3d88e6799879b6e4153b48a3">&#9670;&#160;</a></span>coap_get_session_client_psk()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t coap_get_session_client_psk </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>hint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>hint_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>identity</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>identity_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>max_identity_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>psk</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>max_psk_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00294">294</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a32887948ee273d1ad464ec47df194910" name="a32887948ee273d1ad464ec47df194910"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a32887948ee273d1ad464ec47df194910">&#9670;&#160;</a></span>coap_handle_dgram()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_handle_dgram </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>data_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Parses and interprets a CoAP datagram with context <code>ctx</code>. </p>
<p>This function returns <code>0</code> if the datagram was handled, or a value less than zero on error.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>The current CoAP context. </td></tr>
    <tr><td class="paramname">session</td><td>The current CoAP session. </td></tr>
    <tr><td class="paramname">data</td><td>The received packet'd data. </td></tr>
    <tr><td class="paramname">data_len</td><td>The received packet'd data length.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>0</code> if message was handled successfully, or less than zero on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01369">1369</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a8534f7860b14e0743529daff196a27ce" name="a8534f7860b14e0743529daff196a27ce"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8534f7860b14e0743529daff196a27ce">&#9670;&#160;</a></span>coap_handle_dgram_for_proto()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int coap_handle_dgram_for_proto </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__packet__t.html">coap_packet_t</a> *&#160;</td>
          <td class="paramname"><em>packet</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01024">1024</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a5e2cee998ccf618ac07aa54f5e5f8743" name="a5e2cee998ccf618ac07aa54f5e5f8743"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5e2cee998ccf618ac07aa54f5e5f8743">&#9670;&#160;</a></span>coap_handle_event()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_handle_event </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__events.html#ga75a08ceb9a855937288ac3996656c872">coap_event_t</a>&#160;</td>
          <td class="paramname"><em>event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Invokes the event handler of <code>context</code> for the given <code>event</code> and <code>data</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The CoAP context whose event handler is to be called. </td></tr>
    <tr><td class="paramname">event</td><td>The event to deliver. </td></tr>
    <tr><td class="paramname">session</td><td>The session related to <code>event</code>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The result from the associated event handler or 0 if none was registered. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l02310">2310</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a80d2c3b0141e98bf3f7914e7e59b9530" name="a80d2c3b0141e98bf3f7914e7e59b9530"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a80d2c3b0141e98bf3f7914e7e59b9530">&#9670;&#160;</a></span>coap_insert_node()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_insert_node </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__queue__t.html">coap_queue_t</a> **&#160;</td>
          <td class="paramname"><em>queue</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *&#160;</td>
          <td class="paramname"><em>node</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Adds <code>node</code> to given <code>queue</code>, ordered by variable t in <code>node</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">queue</td><td>Queue to add to. </td></tr>
    <tr><td class="paramname">node</td><td>Node entry to add to Queue.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> added to queue, <code>0</code> failure. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00188">188</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="ad76ef4794cfee9fd5d3cd65e30f77b5d" name="ad76ef4794cfee9fd5d3cd65e30f77b5d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad76ef4794cfee9fd5d3cd65e30f77b5d">&#9670;&#160;</a></span>coap_malloc_node()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> <a class="el" href="structcoap__queue__t.html">coap_queue_t</a> * coap_malloc_node </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00091">91</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a1ab369ca0a3c4fe7f8a9e0536346ff71" name="a1ab369ca0a3c4fe7f8a9e0536346ff71"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1ab369ca0a3c4fe7f8a9e0536346ff71">&#9670;&#160;</a></span>coap_new_context()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__context__t.html">coap_context_t</a> * coap_new_context </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structcoap__address__t.html">coap_address_t</a> *&#160;</td>
          <td class="paramname"><em>listen_addr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates a new <a class="el" href="structcoap__context__t.html" title="The CoAP stack&#39;s global state is stored in a coap_context_t object.">coap_context_t</a> object that will hold the CoAP stack status. </p>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00422">422</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="aa54bb684429ee455f119fc5fb1feb197" name="aa54bb684429ee455f119fc5fb1feb197"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa54bb684429ee455f119fc5fb1feb197">&#9670;&#160;</a></span>coap_new_error_response()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> * coap_new_error_response </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td>
          <td class="paramname"><em>request</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>code</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a>&#160;</td>
          <td class="paramname"><em>opts</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates a new ACK PDU with specified error <code>code</code>. </p>
<p>The options specified by the filter expression <code>opts</code> will be copied from the original request contained in <code>request</code>. Unless <code>SHORT_ERROR_RESPONSE</code> was defined at build time, the textual reason phrase for <code>code</code> will be added as payload, with Content-Type <code>0</code>. This function returns a pointer to the new response message, or <code>NULL</code> on error. The storage allocated for the new message must be relased with <a class="el" href="mem_8h.html#a1e46a1505bb13f03fdacd5d1b32502a6" title="Wrapper function to coap_free_type() for backwards compatibility.">coap_free()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">request</td><td>Specification of the received (confirmable) request. </td></tr>
    <tr><td class="paramname">code</td><td>The error code to set. </td></tr>
    <tr><td class="paramname">opts</td><td>An option filter that specifies which options to copy from the original request in <code>node</code>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the new message or <code>NULL</code> on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01533">1533</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="adbf4c617bdb13f0b61f83dca2ecdcc9e" name="adbf4c617bdb13f0b61f83dca2ecdcc9e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adbf4c617bdb13f0b61f83dca2ecdcc9e">&#9670;&#160;</a></span>coap_new_node()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__queue__t.html">coap_queue_t</a> * coap_new_node </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates a new node suitable for adding to the CoAP sendqueue. </p>
<dl class="section return"><dt>Returns</dt><dd>New node entry, or <code>NULL</code> if failure. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00254">254</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a9c6736c0418c3adf5e7f6fb76f000cfe" name="a9c6736c0418c3adf5e7f6fb76f000cfe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9c6736c0418c3adf5e7f6fb76f000cfe">&#9670;&#160;</a></span>coap_option_check_critical()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_option_check_critical </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td>
          <td class="paramname"><em>pdu</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a>&#160;</td>
          <td class="paramname"><em>unknown</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Verifies that <code>pdu</code> contains no unknown critical options. </p>
<p>Options must be registered at <code>ctx</code>, using the function <a class="el" href="net_8h.html#a696acd1012ad1c2dba081ee5bea54fd8" title="Registers the option type type with the given context object ctx.">coap_register_option()</a>. A basic set of options is registered automatically by <a class="el" href="net_8h.html#a1ab369ca0a3c4fe7f8a9e0536346ff71" title="Creates a new coap_context_t object that will hold the CoAP stack status.">coap_new_context()</a>. This function returns <code>1</code> if <code>pdu</code> is ok, <code>0</code> otherwise. The given filter object <code>unknown</code> will be updated with the unknown options. As only <code>COAP_MAX_OPT</code> options can be signalled this way, remaining options must be examined manually.</p>
<div class="fragment"><div class="line"><a class="code hl_typedef" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a> f = COAP_OPT_NONE;</div>
<div class="line"><a class="code hl_struct" href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a> opt_iter;</div>
<div class="line"> </div>
<div class="line"><span class="keywordflow">if</span> (<a class="code hl_function" href="net_8c.html#a9c6736c0418c3adf5e7f6fb76f000cfe">coap_option_check_critical</a>(ctx, pdu, f) == 0) {</div>
<div class="line">  <a class="code hl_function" href="group__opt__filter.html#gaa76930050882387b0f5c7d0246e14440">coap_option_iterator_init</a>(pdu, &amp;opt_iter, f);</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">while</span> (<a class="code hl_function" href="group__opt__filter.html#ga19d4dbbc03ef362996964fbfdd1d4c7b">coap_option_next</a>(&amp;opt_iter)) {</div>
<div class="line">    <span class="keywordflow">if</span> (opt_iter.<a class="code hl_variable" href="structcoap__opt__iterator__t.html#a0df30f4a2bb85deb3d493fded6967b9d">type</a> &amp; 0x01) {</div>
<div class="line">      ... handle unknown critical option in opt_iter ...</div>
<div class="line">    }</div>
<div class="line">  }</div>
<div class="line">}</div>
<div class="ttc" id="agroup__opt__filter_html_ga001c5b06ae9e02996509516871cb69a8"><div class="ttname"><a href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a></div><div class="ttdeci">uint16_t coap_opt_filter_t[COAP_OPT_FILTER_SIZE]</div><div class="ttdoc">Fixed-size vector we use for option filtering.</div><div class="ttdef"><b>Definition</b> <a href="option_8h_source.html#l00119">option.h:119</a></div></div>
<div class="ttc" id="agroup__opt__filter_html_ga19d4dbbc03ef362996964fbfdd1d4c7b"><div class="ttname"><a href="group__opt__filter.html#ga19d4dbbc03ef362996964fbfdd1d4c7b">coap_option_next</a></div><div class="ttdeci">coap_opt_t * coap_option_next(coap_opt_iterator_t *oi)</div><div class="ttdoc">Updates the iterator oi to point to the next option.</div><div class="ttdef"><b>Definition</b> <a href="option_8c_source.html#l00157">option.c:157</a></div></div>
<div class="ttc" id="agroup__opt__filter_html_gaa76930050882387b0f5c7d0246e14440"><div class="ttname"><a href="group__opt__filter.html#gaa76930050882387b0f5c7d0246e14440">coap_option_iterator_init</a></div><div class="ttdeci">coap_opt_iterator_t * coap_option_iterator_init(const coap_pdu_t *pdu, coap_opt_iterator_t *oi, const coap_opt_filter_t filter)</div><div class="ttdoc">Initializes the given option iterator oi to point to the beginning of the pdu's option list.</div><div class="ttdef"><b>Definition</b> <a href="option_8c_source.html#l00121">option.c:121</a></div></div>
<div class="ttc" id="anet_8c_html_a9c6736c0418c3adf5e7f6fb76f000cfe"><div class="ttname"><a href="net_8c.html#a9c6736c0418c3adf5e7f6fb76f000cfe">coap_option_check_critical</a></div><div class="ttdeci">int coap_option_check_critical(coap_context_t *ctx, coap_pdu_t *pdu, coap_opt_filter_t unknown)</div><div class="ttdoc">Verifies that pdu contains no unknown critical options.</div><div class="ttdef"><b>Definition</b> <a href="net_8c_source.html#l00561">net.c:561</a></div></div>
<div class="ttc" id="astructcoap__opt__iterator__t_html"><div class="ttname"><a href="structcoap__opt__iterator__t.html">coap_opt_iterator_t</a></div><div class="ttdoc">Iterator to run through PDU options.</div><div class="ttdef"><b>Definition</b> <a href="option_8h_source.html#l00237">option.h:237</a></div></div>
<div class="ttc" id="astructcoap__opt__iterator__t_html_a0df30f4a2bb85deb3d493fded6967b9d"><div class="ttname"><a href="structcoap__opt__iterator__t.html#a0df30f4a2bb85deb3d493fded6967b9d">coap_opt_iterator_t::type</a></div><div class="ttdeci">uint16_t type</div><div class="ttdoc">decoded option type</div><div class="ttdef"><b>Definition</b> <a href="option_8h_source.html#l00239">option.h:239</a></div></div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>The context where all known options are registered. </td></tr>
    <tr><td class="paramname">pdu</td><td>The PDU to check. </td></tr>
    <tr><td class="paramname">unknown</td><td>The output filter that will be updated to indicate the unknown critical options found in <code>pdu</code>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if everything was ok, <code>0</code> otherwise. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00561">561</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a4a9f7d31eafd7d82776f9b1a9291eea0" name="a4a9f7d31eafd7d82776f9b1a9291eea0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4a9f7d31eafd7d82776f9b1a9291eea0">&#9670;&#160;</a></span>coap_peek_next()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__queue__t.html">coap_queue_t</a> * coap_peek_next </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the next pdu to send without removing from sendqeue. </p>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00270">270</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a740acba1e579ecec3c67eca3b7522164" name="a740acba1e579ecec3c67eca3b7522164"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a740acba1e579ecec3c67eca3b7522164">&#9670;&#160;</a></span>coap_pop_next()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__queue__t.html">coap_queue_t</a> * coap_pop_next </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the next pdu to send and removes it from the sendqeue. </p>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00278">278</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a0748d791fd2af516dd93fbadb660d440" name="a0748d791fd2af516dd93fbadb660d440"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0748d791fd2af516dd93fbadb660d440">&#9670;&#160;</a></span>coap_read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_read </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a>&#160;</td>
          <td class="paramname"><em>now</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>For applications with their own message loop, reads all data from the network. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ctx</td><td>The CoAP context </td></tr>
    <tr><td class="paramname">now</td><td>Current time </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01319">1319</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a44ffb4b70e537043e9a9cf344be24b92" name="a44ffb4b70e537043e9a9cf344be24b92"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a44ffb4b70e537043e9a9cf344be24b92">&#9670;&#160;</a></span>coap_read_endpoint()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int coap_read_endpoint </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__endpoint__t.html">coap_endpoint_t</a> *&#160;</td>
          <td class="paramname"><em>endpoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a>&#160;</td>
          <td class="paramname"><em>now</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01256">1256</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="acd36f6fba6d30ab9557e0e6521f4a088" name="acd36f6fba6d30ab9557e0e6521f4a088"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acd36f6fba6d30ab9557e0e6521f4a088">&#9670;&#160;</a></span>coap_read_session()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void coap_read_session </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a>&#160;</td>
          <td class="paramname"><em>now</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01126">1126</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a480a3e967feaf00778dedf4c2fc68bd2" name="a480a3e967feaf00778dedf4c2fc68bd2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a480a3e967feaf00778dedf4c2fc68bd2">&#9670;&#160;</a></span>coap_remove_from_queue()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int coap_remove_from_queue </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__queue__t.html">coap_queue_t</a> **&#160;</td>
          <td class="paramname"><em>queue</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="pdu_8h.html#ac60fb9284ace878df3db4a2d621d9a8d">coap_tid_t</a>&#160;</td>
          <td class="paramname"><em>id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__queue__t.html">coap_queue_t</a> **&#160;</td>
          <td class="paramname"><em>node</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function removes the element with given <code>id</code> from the list given list. </p>
<p>If <code>id</code> was found, <code>node</code> is updated to point to the removed element. Note that the storage allocated by <code>node</code> is <b>not</b> released. The caller must do this manually using <a class="el" href="net_8h.html#a44c39a2314035989d3e07b9d9328e08c" title="Destroys specified node.">coap_delete_node()</a>. This function returns <code>1</code> if the element with id <code>id</code> was found, <code>0</code> otherwise. For a return value of <code>0</code>, the contents of <code>node</code> is undefined.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">queue</td><td>The queue to search for <code>id</code>. </td></tr>
    <tr><td class="paramname">session</td><td>The session to look for. </td></tr>
    <tr><td class="paramname">id</td><td>The transaction id to look for. </td></tr>
    <tr><td class="paramname">node</td><td>If found, <code>node</code> is updated to point to the removed node. You must release the storage pointed to by <code>node</code> manually.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>1</code> if <code>id</code> was found, <code>0</code> otherwise. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01397">1397</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a9900c032b74bd57f67d489484a2b3207" name="a9900c032b74bd57f67d489484a2b3207"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9900c032b74bd57f67d489484a2b3207">&#9670;&#160;</a></span>coap_retransmit()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pdu_8h.html#ac60fb9284ace878df3db4a2d621d9a8d">coap_tid_t</a> coap_retransmit </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *&#160;</td>
          <td class="paramname"><em>node</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Handles retransmissions of confirmable messages. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The CoAP context. </td></tr>
    <tr><td class="paramname">node</td><td>The node to retransmit.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The message id of the sent message or <code>COAP_INVALID_TID</code> on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00931">931</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="ab0b0b5db03427c4313c01ec2b12cf8ed" name="ab0b0b5db03427c4313c01ec2b12cf8ed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab0b0b5db03427c4313c01ec2b12cf8ed">&#9670;&#160;</a></span>coap_send()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pdu_8h.html#ac60fb9284ace878df3db4a2d621d9a8d">coap_tid_t</a> coap_send </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td>
          <td class="paramname"><em>pdu</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sends a CoAP message to given peer. </p>
<p>The memory that is allocated by pdu will be released by <a class="el" href="net_8h.html#ab0b0b5db03427c4313c01ec2b12cf8ed" title="Sends a CoAP message to given peer.">coap_send()</a>. The caller must not use the pdu after calling <a class="el" href="net_8h.html#ab0b0b5db03427c4313c01ec2b12cf8ed" title="Sends a CoAP message to given peer.">coap_send()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">session</td><td>The CoAP session. </td></tr>
    <tr><td class="paramname">pdu</td><td>The CoAP PDU to send.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The message id of the sent message or <code>COAP_INVALID_TID</code> on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00876">876</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="aba278b109415057d15196fa46afee970" name="aba278b109415057d15196fa46afee970"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aba278b109415057d15196fa46afee970">&#9670;&#160;</a></span>coap_send_ack()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pdu_8h.html#ac60fb9284ace878df3db4a2d621d9a8d">coap_tid_t</a> coap_send_ack </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td>
          <td class="paramname"><em>request</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sends an ACK message with code <code>0</code> for the specified <code>request</code> to <code>dst</code>. </p>
<p>This function returns the corresponding transaction id if the message was sent or <code>COAP_INVALID_TID</code> on error.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">session</td><td>The CoAP session. </td></tr>
    <tr><td class="paramname">request</td><td>The request to be acknowledged.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The transaction id if ACK was sent or <code>COAP_INVALID_TID</code> on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00613">613</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="ab31cd76353f751ec4dc5c033152df575" name="ab31cd76353f751ec4dc5c033152df575"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab31cd76353f751ec4dc5c033152df575">&#9670;&#160;</a></span>coap_send_error()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pdu_8h.html#ac60fb9284ace878df3db4a2d621d9a8d">coap_tid_t</a> coap_send_error </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td>
          <td class="paramname"><em>request</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>code</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__opt__filter.html#ga001c5b06ae9e02996509516871cb69a8">coap_opt_filter_t</a>&#160;</td>
          <td class="paramname"><em>opts</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sends an error response with code <code>code</code> for request <code>request</code> to <code>dst</code>. </p>
<p><code>opts</code> will be passed to <a class="el" href="net_8h.html#aa54bb684429ee455f119fc5fb1feb197" title="Creates a new ACK PDU with specified error code.">coap_new_error_response()</a> to copy marked options from the request. This function returns the transaction id if the message was sent, or <code>COAP_INVALID_TID</code> otherwise.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">session</td><td>The CoAP session. </td></tr>
    <tr><td class="paramname">request</td><td>The original request to respond to. </td></tr>
    <tr><td class="paramname">code</td><td>The response code. </td></tr>
    <tr><td class="paramname">opts</td><td>A filter that specifies the options to copy from the <code>request</code>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The transaction id if the message was sent, or <code>COAP_INVALID_TID</code> otherwise. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00754">754</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a6aa830b46188549b51773f724eb8e752" name="a6aa830b46188549b51773f724eb8e752"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6aa830b46188549b51773f724eb8e752">&#9670;&#160;</a></span>coap_send_message_type()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pdu_8h.html#ac60fb9284ace878df3db4a2d621d9a8d">coap_tid_t</a> coap_send_message_type </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td>
          <td class="paramname"><em>request</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned char&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Helper funktion to create and send a message with <code>type</code> (usually ACK or RST). </p>
<p>This function returns <code>COAP_INVALID_TID</code> when the message was not sent, a valid transaction id otherwise.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">session</td><td>The CoAP session. </td></tr>
    <tr><td class="paramname">request</td><td>The request that should be responded to. </td></tr>
    <tr><td class="paramname">type</td><td>Which type to set. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>transaction id on success or <code>COAP_INVALID_TID</code> otherwise. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00772">772</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a0c600aed61c8a8402d31ef795df3b0b6" name="a0c600aed61c8a8402d31ef795df3b0b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0c600aed61c8a8402d31ef795df3b0b6">&#9670;&#160;</a></span>coap_send_pdu()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static ssize_t coap_send_pdu </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td>
          <td class="paramname"><em>pdu</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *&#160;</td>
          <td class="paramname"><em>node</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00655">655</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="aaf20c9b0b2ad3168c15e535a67ea3ce5" name="aaf20c9b0b2ad3168c15e535a67ea3ce5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaf20c9b0b2ad3168c15e535a67ea3ce5">&#9670;&#160;</a></span>coap_session_send_pdu()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ssize_t coap_session_send_pdu </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td>
          <td class="paramname"><em>pdu</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Send a pdu according to the session's protocol. </p>
<p>This function returns the number of bytes that have been transmitted, or a value less than zero on error.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">session</td><td>Session to send pdu on. </td></tr>
    <tr><td class="paramname">pdu</td><td>The pdu to send.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes written on success, or a value less than zero on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00627">627</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="aae36aa264dea395214cf7aabcee5fcd9" name="aae36aa264dea395214cf7aabcee5fcd9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aae36aa264dea395214cf7aabcee5fcd9">&#9670;&#160;</a></span>coap_set_app_data()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_set_app_data </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Stores <code>data</code> with the given CoAP context. </p>
<p>This function overwrites any value that has previously been stored with <code>context</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The CoAP context. </td></tr>
    <tr><td class="paramname">data</td><td>The data to store with wih the context. Note that this data must be valid during the lifetime of <code>context</code>. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00506">506</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="aceceb550566e0ab9e184d09604a73bb6" name="aceceb550566e0ab9e184d09604a73bb6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aceceb550566e0ab9e184d09604a73bb6">&#9670;&#160;</a></span>coap_startup()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void coap_startup </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l02343">2343</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a7bee391c13b539a24d9f74b2fc23e08a" name="a7bee391c13b539a24d9f74b2fc23e08a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7bee391c13b539a24d9f74b2fc23e08a">&#9670;&#160;</a></span>coap_wait_ack()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pdu_8h.html#ac60fb9284ace878df3db4a2d621d9a8d">coap_tid_t</a> coap_wait_ack </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__queue__t.html">coap_queue_t</a> *&#160;</td>
          <td class="paramname"><em>node</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l00824">824</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a4b9a31728201d9c7c032513a185854ff" name="a4b9a31728201d9c7c032513a185854ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4b9a31728201d9c7c032513a185854ff">&#9670;&#160;</a></span>coap_wellknown_response()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> * coap_wellknown_response </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td>
          <td class="paramname"><em>request</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates a new response for given <code>request</code> with the contents of <code></code>.well-known/core. </p>
<p>The result is NULL on error or a newly allocated PDU that must be either sent with coap_sent() or released by <a class="el" href="pdu_8c.html#a48581f968a30ef4278702eb1c16b7a90" title="Dispose of an CoAP PDU and frees associated storage.">coap_delete_pdu()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">context</td><td>The current coap context to use. </td></tr>
    <tr><td class="paramname">session</td><td>The CoAP session. </td></tr>
    <tr><td class="paramname">request</td><td>The request for <code></code>.well-known/core .</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A new 2.05 response for <code></code>.well-known/core or NULL on error. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01649">1649</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a823b9397a80e37f7ae87a5581430c507" name="a823b9397a80e37f7ae87a5581430c507"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a823b9397a80e37f7ae87a5581430c507">&#9670;&#160;</a></span>coap_write_endpoint()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static int coap_write_endpoint </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__endpoint__t.html">coap_endpoint_t</a> *&#160;</td>
          <td class="paramname"><em>endpoint</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a>&#160;</td>
          <td class="paramname"><em>now</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01302">1302</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a8fe30a827bdd0d518fc5c5a3a860dfde" name="a8fe30a827bdd0d518fc5c5a3a860dfde"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8fe30a827bdd0d518fc5c5a3a860dfde">&#9670;&#160;</a></span>coap_write_session()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void coap_write_session </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>ctx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a>&#160;</td>
          <td class="paramname"><em>now</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01071">1071</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a4dc6e755dca2ca804e8700f398f4c329" name="a4dc6e755dca2ca804e8700f398f4c329"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4dc6e755dca2ca804e8700f398f4c329">&#9670;&#160;</a></span>get_wkc_len()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> size_t get_wkc_len </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *&#160;</td>
          <td class="paramname"><em>query_filter</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Quick hack to determine the size of the resource description for .well-known/core. </p>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01631">1631</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a1a280312c4bad55cf10243b9b9c3e966" name="a1a280312c4bad55cf10243b9b9c3e966"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1a280312c4bad55cf10243b9b9c3e966">&#9670;&#160;</a></span>handle_request()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void handle_request </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td>
          <td class="paramname"><em>pdu</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01883">1883</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="af838d89087ad96495f8ed7f1a9297168" name="af838d89087ad96495f8ed7f1a9297168"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af838d89087ad96495f8ed7f1a9297168">&#9670;&#160;</a></span>handle_response()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void handle_response </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td>
          <td class="paramname"><em>sent</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td>
          <td class="paramname"><em>rcvd</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l02111">2111</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="ac4cbcfd073489b57805db665ce3d0681" name="ac4cbcfd073489b57805db665ce3d0681"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac4cbcfd073489b57805db665ce3d0681">&#9670;&#160;</a></span>handle_signaling()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void handle_signaling </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__context__t.html">coap_context_t</a> *&#160;</td>
          <td class="paramname"><em>context</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__session__t.html">coap_session_t</a> *&#160;</td>
          <td class="paramname"><em>session</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td>
          <td class="paramname"><em>pdu</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l02129">2129</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="aa708f479d33a6ca76bf214a0e0e42de4" name="aa708f479d33a6ca76bf214a0e0e42de4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa708f479d33a6ca76bf214a0e0e42de4">&#9670;&#160;</a></span>no_response()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static enum <a class="el" href="net_8c.html#a19fccec23349a25f5daa69fc231cb415">respond_t</a> no_response </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td>
          <td class="paramname"><em>request</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *&#160;</td>
          <td class="paramname"><em>response</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Checks for No-Response option in given <code>request</code> and returns <code>1</code> if <code>response</code> should be suppressed according to RFC 7967. </p>
<p>The value of the No-Response option is encoded as follows:</p>
<pre class="fragment">*  +-------+-----------------------+-----------------------------------+
*  | Value | Binary Representation |          Description              |
*  +-------+-----------------------+-----------------------------------+
*  |   0   |      &lt;empty&gt;          | Interested in all responses.      |
*  +-------+-----------------------+-----------------------------------+
*  |   2   |      00000010         | Not interested in 2.xx responses. |
*  +-------+-----------------------+-----------------------------------+
*  |   8   |      00001000         | Not interested in 4.xx responses. |
*  +-------+-----------------------+-----------------------------------+
*  |  16   |      00010000         | Not interested in 5.xx responses. |
*  +-------+-----------------------+-----------------------------------+
* </pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">request</td><td>The CoAP request to check for the No-Response option. This parameter must not be NULL. </td></tr>
    <tr><td class="paramname">response</td><td>The response that is potentially suppressed. This parameter must not be NULL. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>RESPONSE_DEFAULT when no special treatment is requested, RESPONSE_DROP when the response must be discarded, or RESPONSE_SEND when the response must be sent. </dd></dl>

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01845">1845</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a172ec052726c632427ea990a0ba04c60" name="a172ec052726c632427ea990a0ba04c60"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a172ec052726c632427ea990a0ba04c60">&#9670;&#160;</a></span>token_match()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> int token_match </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>alen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *&#160;</td>
          <td class="paramname"><em>b</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>blen</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01441">1441</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="a3e4402058bf2b1ef0b513175af4e600d" name="a3e4402058bf2b1ef0b513175af4e600d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3e4402058bf2b1ef0b513175af4e600d">&#9670;&#160;</a></span>coap_default_uri_wellknown</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structcoap__str__const__t.html">coap_str_const_t</a> coap_default_uri_wellknown</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">=</div>
<div class="line">          { <span class="keyword">sizeof</span>(<a class="code hl_define" href="pdu_8h.html#ae988ff4a542f3add75af84433693c134">COAP_DEFAULT_URI_WELLKNOWN</a>)-1,</div>
<div class="line">           (<span class="keyword">const</span> <a class="code hl_typedef" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *)<a class="code hl_define" href="pdu_8h.html#ae988ff4a542f3add75af84433693c134">COAP_DEFAULT_URI_WELLKNOWN</a> }</div>
<div class="ttc" id="apdu_8h_html_ae988ff4a542f3add75af84433693c134"><div class="ttname"><a href="pdu_8h.html#ae988ff4a542f3add75af84433693c134">COAP_DEFAULT_URI_WELLKNOWN</a></div><div class="ttdeci">#define COAP_DEFAULT_URI_WELLKNOWN</div><div class="ttdoc">well-known resources URI</div><div class="ttdef"><b>Definition</b> <a href="pdu_8h_source.html#l00068">pdu.h:68</a></div></div>
<div class="ttc" id="authash_8h_html_aba7bc1797add20fe3efdf37ced1182c5"><div class="ttname"><a href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a></div><div class="ttdeci">unsigned char uint8_t</div><div class="ttdef"><b>Definition</b> <a href="uthash_8h_source.html#l00079">uthash.h:79</a></div></div>
</div><!-- fragment -->
<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l01878">1878</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
<a id="a73dd0093b2de859341ebbb375b0efad5" name="a73dd0093b2de859341ebbb375b0efad5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a73dd0093b2de859341ebbb375b0efad5">&#9670;&#160;</a></span>coap_started</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int coap_started = 0</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="net_8c_source.html#l02341">2341</a> of file <a class="el" href="net_8c_source.html">net.c</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="net_8c.html">net.c</a></li>
    <li class="footer">Generated on Fri Dec 27 2024 09:57:44 for libcoap by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
  </ul>
</div>
</body>
</html>
